package com.et.util

import android.util.Log

import org.junit.Test
import java.io.File

class HttpUtilKtTest {

    @Test
    fun download() {
        val file = File("/sdcard/${System.currentTimeMillis()}.download")
        val url =
            "https://media.w3.org/2010/05/sintel/trailer.mp4"
        file.download(url) {
            when {
                it < 0 -> {
                    Log.d("TAGS.vending", "vending:callback download failed")
                }
                it == 1f -> {
                    Log.d("TAGS.vending", "vending:callback download finish")
                }
                else -> {
                    Log.d("TAGS.vending>>", it.toString())
                }
            }
        }
    }
}